package com.kehutong.payfees.enums;

import org.coraframework.util.HashID;

/**
 * @Author: liuzhen (liuxing521a@163.com)
 * @Date: 20/4/13 上午11:44
 */
public enum Gender implements HashID {

    NOMORE("0", "未知"),
    FEMALE("1", "男"),
    MALE("2", "女"),

    ;
    private final String id;
    private final String desc;

    private Gender(String id, String desc) {
        this.id = id;
        this.desc = desc;
    }

    public static String getId(String desc) {
        Gender[] genderEnums = values();
        for (Gender gender : genderEnums) {
            if (gender.getDesc().equals(desc)) {
                return gender.getId();
            }
        }
        return null;
    }


    @Override
    public String getId() {
        return id;
    }

    @Override
    public String getDesc() {
        return desc;
    }
}
